package com.qf.controller;

import com.qf.model.Account;
import com.qf.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName AccountController
 * @Description TODO
 * @Author 86181
 * @Date 2022/9/6 20:32
 * @Version 1.0
 **/
@RestController
@RequestMapping("account")
public class AccountController {
    public AccountController(){
        System.out.println("初始化l");
    }
    @Autowired
    private AccountService accountService;

    @RequestMapping("findAll")
    public List<Account> findAll(){
        List<Account> all = accountService.findAll();
        for (Account account : all) {
            System.out.println(account);
        }
        return all;
    }
}
